import request from '@/utils/request'
import axios from 'axios'

// 接口地址
// var baseUri = 'http://cdwlc.dmctv.cn/api';
// var baseUri = 'http://10.10.2.46:5551/bim';
const baseUrl = 'http://10.23.100.71:5551/bim'
// 文件地址
// var fileUrl = 'http://47.93.136.18:82/file';
export const fileUrl =
  'http://10.23.100.71:5551/resource/file/download?pkid='

// 获取企业人员测试数据
export function getEnterpriseInfo(query) {
  return request({
    url: baseUrl + '/entinfo/dlist',
    method: 'get',
    params: query
  })
  /*
    return axios({
      method: "get",
      url: "./json/bim_qy.json"
    });
    */
}

// 楼层显示数据及
export function getFloorInfo() {
  return axios({
    method: 'get',
    url: './json/bim_floor.json'
  })
}

// 一栋建筑信息
export function getBuildingInfoByName(buildingName) {
  return request({
    method: 'get',
    url:
      baseUrl + `/blding/list?buildingName=${buildingName}`
  })
}

// 获取阶段z 根据  layerId
export function getStageByLayerId(layerId) {
  return request({
    method: 'get',
    url: baseUrl + `/layerstage/list?layerId=${layerId}`
  })
}

// 楼层显示数据 根据建筑名称
export function getFloorListByBldName(buildingName) {
  return request({
    method: 'get',
    url:
      baseUrl +
      `/flooinfo/list?buildingName=${buildingName}`
  })
}

// 楼层一层信息
export function getFloorByName(buildingName, floorName) {
  return request({
    method: 'get',
    url:
      baseUrl +
      `/flooinfo/list?buildingName=${buildingName}&floorName=${floorName}`
  })
}

// 楼层一层信息 及楼层的企业
// buildingName=国际教育产业园_1号楼&floorName=F4
export function getFloorByQyNames(buildingName, floorName) {
  return request({
    method: 'get',
    url:
      baseUrl +
      `/flooinfo/getoneByNames?buildingName=${buildingName}&floorName=${floorName}`
  })
}

// 楼层显示数据 根据建筑id
export function getFloorListByBldId(buildingId) {
  return request({
    method: 'get',
    url: baseUri + `/flooinfo/list?buildingId=${buildingId}`
  })
}

// 功能区
export function getGnListByBld(buildingName, floorName) {
  return request({
    method: 'get',
    url:
      baseUrl +
      `/flooinfo/gnlist?buildingName=${buildingName}&floorName=${floorName}`
  })
}
